<?php

class LoggedManager {
	private $id;
	private $email;
	private $teamName;
	private $manName;
	private $logManScore;
	CONST NOT_SELECTED_SQUAD = 0;
	
	public function __construct($email){
		$this->setEmail($email);
		$this->setId($email);
		$this->setTeamName($email);
		$this->setManName($email);
		$this->setLogManScore($email);
	}
	
	public function getEmail(){
		return $this->email;
	}
	
	public function setEmail($email){
		$this->email = $email;
	}
	
	public function getId(){
		return $this->id;
	}
	public function setId($email){
		$dbconnect = DBconnect::getInstance();
		$this->id = $dbconnect->getManagerId($email);
	}
	
	public function getTeamName(){
		return $this->teamName;
	}

	public function getManName(){
		return $this->manName;
	}
	
	public function getLogManScore(){
		return $this->logManScore;
	}
	
	public function setLogManScore($email){
		$dbconnect = DBconnect::getInstance();
		$this->logManScore = $dbconnect->getLogManagerScore($email);		
	}

	public function setManName($email){
		$dbconnect = DBconnect::getInstance();
		$this->manName = $dbconnect->getManagerName($email);
	}
	
	public function setTeamName($email){
		$dbconnect = DBconnect::getInstance();
		$this->teamName = $dbconnect->getTeamName($email);
	}
	
	public function getSelectedPlayers(){
		$dbconnect = DBconnect::getInstance();
			if(mysql_num_rows($dbconnect->getManagerSquad($this->id)) > 0)
				return $dbconnect->getManagerSquad($this->id);
			else 
				return  self::NOT_SELECTED_SQUAD;	
	}
	
}

?>